/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.sd.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 来文登记表Entity
 * @author zhanchj
 * @version 2020-06-30
 */
@Table(name = "sd_doc_recv", alias = "a", columns = {
		@Column(name = "id", attrName = "id", label = "来文ID", isPK = true),
		@Column(name = "doc_title", attrName = "docTitle", label = "来文标题", queryType = QueryType.LIKE),
		@Column(name = "doc_full_num", attrName = "docFullNum", label = "来文文号，如粤密[2020]1号"),
		@Column(name = "doc_sys_code", attrName = "docSysCode", label = "来文自编号，自定义编号，如dg", comment = "来文自编号，自定义编号，如dg(2020)4029"),
		@Column(name = "doc_emerg_lvl", attrName = "docEmergLvl", label = "紧急程度", comment = "紧急程度(1 普通，2 特急，3 特提)"),
		@Column(name = "sec_lvl", attrName = "secLvl", label = "密级 1", comment = "密级 1：公开 2：内部 3：秘密 4：机密 5：绝密"),
		@Column(name = "unit_code", attrName = "unitCode", label = "来文单位ID"),
		@Column(name = "doc_type", attrName = "docType", label = "来文类型", comment = "来文类型（1：局直单位发文 2：密件，3：省厅密电）"),
		@Column(name = "doc_recv_date", attrName = "docRecvDate", label = "来文日期，用户可选择"),
		@Column(name = "file_count", attrName = "fileCount", label = "来文份数"),
		@Column(name = "page_count", attrName = "pageCount", label = "每份页数"),
		@Column(name = "doc_status", attrName = "docStatus", label = "文件状态 ", comment = "文件状态 （0待分发（登记时和拟办完） 1拟办中 2已分发）"),
		@Column(includeEntity = DataEntity.class),
}, joinTable = {
		@JoinTable(type = Type.LEFT_JOIN, entity = UppUnit.class, alias = "u", on = "a.unit_code = u.id", columns = {
				@Column(includeEntity = UppUnit.class)
		})

},

		orderBy = "a.update_date DESC"
)
public class DocRecv extends DataEntity<DocRecv> {

	private static final long serialVersionUID = 1L;

	/**
	 * 来文标题
	 */
	private String docTitle;
	/**
	 * 来文文号，如粤密[2020]1号
	 */
	private String docFullNum;
	/**
	 * 来文自编号，自定义编号，如dg(2020)4029
	 */
	private String docSysCode;
	/**
	 * 紧急程度(1 普通，2 特急，3 特提)
	 */
	private String docEmergLvl;
	/**
	 * 密级 1：公开 2：内部 3：秘密 4：机密 5：绝密
	 */
	private String secLvl;
	/**
	 * 来文单位ID
	 */
	private UppUnit uppUnit;
	private String unitCode;
	/**
	 * 来文类型（1：局直单位发文 2：密件，3：省厅密电）
	 */
	private String docType;
	/**
	 * 来文日期，用户可选择
	 */
	private Date docRecvDate;
	/**
	 * 来文份数
	 */
	private Integer fileCount;
	/**
	 * 每份页数
	 */
	private Integer pageCount;
	/**
	 * 文件状态 （0待分发（登记时和拟办完） 1拟办中 2已分发）
	 */
	private String docStatus;

	private Long counts;

	public DocRecv() {
		this(null);
	}

	public DocRecv(String id) {
		super(id);
	}

	public String getUnitCode() {
		return unitCode;
	}

	public void setUnitCode(String unitCode) {
		this.unitCode = unitCode;
	}

	@NotBlank(message = "来文标题不能为空")
	@Length(min = 0, max = 500, message = "来文标题长度不能超过 500 个字符")
	public String getDocTitle() {
		return docTitle;
	}

	public void setDocTitle(String docTitle) {
		this.docTitle = docTitle;
	}

	@NotBlank(message = "来文文号不能为空")
	@Length(min = 0, max = 100, message = "来文文号长度不能超过100 个字符")
	public String getDocFullNum() {
		return docFullNum;
	}

	public void setDocFullNum(String docFullNum) {
		this.docFullNum = docFullNum;
	}

	@NotBlank(message = "来文自编号不能为空")
	@Length(min = 0, max = 100, message = "来文自编号长度不能超过 100 个字符")
	public String getDocSysCode() {
		return docSysCode;
	}

	public void setDocSysCode(String docSysCode) {
		this.docSysCode = docSysCode;
	}

	@NotBlank(message = "紧急程度不能为空")
	@Length(min = 0, max = 1, message = "紧急程度长度不能超过 1 个字符")
	public String getDocEmergLvl() {
		return docEmergLvl;
	}

	public void setDocEmergLvl(String docEmergLvl) {
		this.docEmergLvl = docEmergLvl;
	}

	@NotBlank(message = "密级不能为空")
	@Length(min = 0, max = 1, message = "密级长度不能超过 1 个字符")
	public String getSecLvl() {
		return secLvl;
	}

	public void setSecLvl(String secLvl) {
		this.secLvl = secLvl;
	}

	public UppUnit getUppUnit() {
		return uppUnit;
	}

	public void setUppUnit(UppUnit uppUnit) {
		this.uppUnit = uppUnit;
	}

	@NotBlank(message = "来文类型不能为空")
	@Length(min = 0, max = 1, message = "来文类型长度不能超过 1 个字符")
	public String getDocType() {
		return docType;
	}

	public void setDocType(String docType) {
		this.docType = docType;
	}

	@JsonFormat(pattern = "yyyy-MM-dd")
	@NotNull(message = "来文日期，用户可选择不能为空")
	public Date getDocRecvDate() {
		return docRecvDate;
	}

	public void setDocRecvDate(Date docRecvDate) {
		this.docRecvDate = docRecvDate;
	}
	
	@NotNull(message="来文份数不能为空")
	public Integer getFileCount() {
		return fileCount;
	}

	public void setFileCount(Integer fileCount) {
		this.fileCount = fileCount;
	}
	
	@NotNull(message="每份页数不能为空")
	public Integer getPageCount() {
		return pageCount;
	}

	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}

	public String getDocStatus() {
		return docStatus;
	}

	public void setDocStatus(String docStatus) {
		this.docStatus = docStatus;
	}

	public Long getCounts() {
		return counts;
	}

	public void setCounts(Long counts) {
		this.counts = counts;
	}
}